-- GENERATED SPELL FOR [Death Watcher] --


function spell0_20867(pUnit, Event) --@Death Count,Self--
pUnit:FullCastSpellOnTarget(36657,pUnit)
pUnit:RegisterEvent('Sorts_20867', 15000, 1)
end

function spell1_20867(pUnit, Event) --@Death Count,Self--
pUnit:FullCastSpellOnTarget(38818,pUnit)
pUnit:RegisterEvent('Sorts_20867', 12000, 1)
end

function spell2_20867(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(36655,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_20867', 5000, 1)
end

function spell3_20867(pUnit, Event) --@Drain Life,Drain--
pUnit:FullCastSpellOnTarget(38817,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_20867', 5000, 1)
end

function spell4_20867(pUnit, Event) --@Tentacle Cleave,n/a--
pUnit:FullCastSpellOnTarget(36664,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20867', 0, 1)
end

function spell5_20867(pUnit, Event) --@Tentacle Cleave,n/a--
pUnit:FullCastSpellOnTarget(38816,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20867', 595, 1)
end

function Sorts_20867(pUnit, Event)
local choix_sorts_20867 = math.random(0, 5)
if choix_sorts_20867 == 0 then
pUnit:RegisterEvent('spell0_20867', 1, 1)
end
if choix_sorts_20867 == 1 then
pUnit:RegisterEvent('spell1_20867', 1, 1)
end
if choix_sorts_20867 == 2 then
pUnit:RegisterEvent('spell2_20867', 1, 1)
end
if choix_sorts_20867 == 3 then
pUnit:RegisterEvent('spell3_20867', 1, 1)
end
if choix_sorts_20867 == 4 then
pUnit:RegisterEvent('spell4_20867', 1, 1)
end
if choix_sorts_20867 == 5 then
pUnit:RegisterEvent('spell5_20867', 1, 1)
end
end

function mob20867_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20867', math.random(1500, 3000), 1)
end

function mob20867_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20867_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20867_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20867, 1, 'mob20867_Action')
RegisterUnitEvent(20867, 2, 'mob20867_Leave')
RegisterUnitEvent(20867, 3, 'mob20867_Kill')
RegisterUnitEvent(20867, 4, 'mob20867_Die')
